package com.demo.database.mapper;

import com.demo.database.data.TDemoPosition;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.cache.decorators.FifoCache;

import java.util.List;

/**
 * @功能
 * @创建时间 2019/12/27
 */
@Mapper
@CacheNamespace(eviction = FifoCache.class,flushInterval = 60000,size = 1024,readWrite = false)
public interface TDemoPositionMapper {
    @Results(id = "positionResouts",value = {
            @Result(property="userId",column = "user_id",id=true),
            @Result(property = "roleId",column = "role_id")
    })
    @Select("select * from chooseuser where user_id = #{userId}")
    public List<TDemoPosition> querry(TDemoPosition position) throws Exception;

    @Insert(" insert into chooseuser(user_id,role_id) values(#{userId},#{roleId})")
    public void add(TDemoPosition position) throws Exception;

}
